package com.process.testprocess;

import java.util.List;

import org.apache.log4j.Logger;

import com.process.dao.ParamProcessGroupUserBean;

import feng.process.api.user.IUserSelect;
import feng.process.dao.QueryDao;

/**
 * 人员选择实现类，需要继承IUserSelect接口
 * @author 冯昌硕
 * @create 2012-10-29 下午7:48:41
 */
public class UserSelectImpl implements IUserSelect {
    
    private static final Logger log = Logger.getLogger(UserSelectImpl.class);

    /**
     * 数据查询Dao
     */
    private QueryDao queryDao;
    
    public UserSelectImpl() throws Exception {
        queryDao = new QueryDao();
    }
    
    /**
     * 人员选择
     * 查询指定环节的待办人员ID
     * @param selectRole 人员查询规则
     * @param templeteName 流程模板
     * @param stepId 要查询的环节ID
     * @return 根据参数指定的规则返回人员选择查询出的待办人员ID
     * @create 2012-10-29 上午12:24:29
     */
    public List<?> getWaitingUserIdLst(String selectRole, String templeteName, String stepId) throws Exception {
        log.debug("待办人员查询 param=[selectRole=["+selectRole+"] templeteName=["+templeteName+"] stepId=["+stepId+"]]");
        
        ParamProcessGroupUserBean paramBean = new ParamProcessGroupUserBean();
        paramBean.setStepId(stepId);
        paramBean.setTempleteName(templeteName);
        
        List<?> userLst = queryDao.queryForList("process_group_user.selWaitUsers", paramBean);
        
        return userLst;
    }

}
